var seller = require('../controller/controller.seller');

module.exports = {


    //根据sellerId获取统计信息
    getSellerList: function (req, res, next) {
        var params = req.query;
        var role = req.session.userinfo.role;

        if (role == '4' || role == '5') {
            params.rowId = req.session.userinfo.seller.rowId;
        }

        seller.getEnabledSellerList(params, function (err, result) {
            if (err) {
                res.redirect('/error');
                return;
            } else {
                next({sellerList:result});
            }
        })

    },
    //根据名称查询券商信息
    getListByName: function (req, res, next) {
        var params = req.query;
        seller.getlistByName(params, function (err, result) {
            if (err) {
                res.redirect('/error');
                return;
            } else {
                next({sellerList:result});
            }
        })

    }
};

